package com.tj.api.rest.account.response;

import com.fqgj.common.utils.StringUtils;
import com.fqgj.exception.common.ApplicationException;

import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * User: anonymous
 * Date: 2020/06/11
 * Time: 下午2:16
 */
public class BindWithDrawAccountResponse implements Serializable {
    private String accountNo;
    private String name;
    private String ifsc;
    private String email;

    private Integer modifyAllow = 0;

    public String getAccountNo() {
        return accountNo;
    }

    public void setAccountNo(String accountNo) {
        this.accountNo = accountNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIfsc() {
        return ifsc;
    }

    public void setIfsc(String ifsc) {
        this.ifsc = ifsc;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Integer getModifyAllow() {
        return modifyAllow;
    }

    public BindWithDrawAccountResponse setModifyAllow(Integer modifyAllow) {
        this.modifyAllow = modifyAllow;
        return this;
    }

    public void verify() {
        if (StringUtils.isEmpty(accountNo)) {
            throw new ApplicationException("account number can not be empty");
        }
        if (StringUtils.isEmpty(name)) {
            throw new ApplicationException("name number can not be empty");
        }
        if (StringUtils.isEmpty(ifsc)) {
            throw new ApplicationException("ifsc number can not be empty");
        }
        if (StringUtils.isEmpty(email)) {
            throw new ApplicationException("email can not be empty");
        }
    }
}